<link href="../js/calendar/blue/blue.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="../js/calendar/Calendar.js"></script>
<form action="member.manage.php" method="post" id="form_modi">
<input type="hidden" name="action" value="modifysave" />
<input type="hidden" name="member_id" value="<tpl> $member_array.member_id </tpl>" />
<table class="from_table" style="margin-top:10px">
  <tr>
    <th width="150" ><tpl> $langSysMemberName </tpl>：</th>
    <td width="480" align="left" class="td1"><tpl> $member_array.login_name </tpl></td>
  </tr>
  <tr>
    <th width="150" ><tpl> $langSysMPassword </tpl>：</th>
    <td width="480" align="left" class="td1"><input name="txtPassword" type="password" class="txtinput" id="txtPassword" /><tpl> $langSysMPasswordRemark </tpl></td>
  </tr>
  <tr>
    <th width="150" ><tpl> $langSysMemtruename </tpl>：</th>
    <td width="480" align="left" class="td1"><input name="txtTruename" type="text" class="txtinput" id="txtTruename" value="<tpl> $member_array.true_name </tpl>" /></td>
  </tr>
  <tr>
    <th width="150" ><tpl> $langSysMbirthday </tpl>：</th>
    <td width="480" align="left" class="td1"><input type="text" name="txtBirthday" id="f_date" readonly="readonly" class="txtinput" style="cursor:pointer" value="<tpl> $member_array.birthday </tpl>" /></td>
  </tr>
    <tr>
    <th width="150" ><tpl> $langSysMememail </tpl>：</th>
    <td width="480" align="left" class="td1"><input name="txtemail" class="txtinput" type="text" id="txtemail"  value="<tpl> $member_array.email </tpl>" /></td>
  </tr>
  <tr>
    <th width="150" ><tpl> $langSysMgender </tpl>：</th>
    <td width="480" align="left" class="td1"><tpl> $gender </tpl></td>
  </tr>
  <tr>
    <th width="150" ><tpl> $langSysMmobilephone </tpl>：</th>
    <td width="480" align="left" class="td1"><input name="txtMobilephone" type="text" id="txtMobilephone"  class="txtinput" value="<tpl> $member_array.mobilephone </tpl>" /></td>
  </tr>
  <tr>
    <th width="150" ><tpl> $langSysMphone </tpl>：</th>
    <td width="480" align="left" class="td1"><input name="txtPhone" type="text" id="txtPhone" class="txtinput"  value="<tpl> $member_array.phone </tpl>" /></td>
  </tr>
  <tr>
    <th width="150" ><tpl> $langSysMotherphone </tpl>：</td>
    <td width="480" align="left" class="td1"><input name="txtOtherphone" type="text" id="txtOtherphone" class="txtinput" value="<tpl> $member_array.otherphone </tpl>" /></td>
  </tr>
  <tr>
    <th width="150" >  <tpl> $langSysMzip </tpl>：
    <td width="480" align="left" class="td1"><input name="txtZip" type="text" id="txtZip" class="txtinput" value="<tpl> $member_array.zip </tpl>" /></td>
  </tr>
  <tr>
    <th width="150">  <tpl> $langSysMaddress </tpl>： 
    <td width="480" align="left" class="td1">
	<input type="hidden" name="area_id" id="area_id" value="<tpl> $member_array.area_id </tpl>" />
	<select id="c1" class="searchformselect" name="c1" style="width: 120px">
		<option valus="" selected></option>
		<tpl> foreach item = parent from = $area_array </tpl>
		<option <tpl> if $sel_area[0].area_id eq $parent.area_id </tpl>selected="selected"<tpl> /if  </tpl> value="<tpl>$parent.area_id</tpl>||<tpl>$parent.is_parent</tpl>"><tpl> $parent.area_name </tpl></option>
	<tpl> /foreach </tpl>
	</select>
	<select class="searchformselect" id="c2" style="width: 120px" name="c2">
		<option valus="<tpl> $sel_area[1].area_id </tpl>" selected><tpl> $sel_area[1].area_name </tpl></option>
	</select>
	<select class="searchformselect" id="c3" style="width: 120px" name="c3">
		<option valus="<tpl> $sel_area[2].area_id </tpl>" selected><tpl> $sel_area[2].area_name </tpl></option>
	</select>
	<select class="searchformselect" id="c4" style="width: 120px" name="c4">
		<option valus="<tpl> $sel_area[3].area_id </tpl>" selected><tpl> $sel_area[3].area_name </tpl></option>
	</select>
	<label style="display:none" for="area_id" class="error" metaDone="true" generated="true"></label>
	<br />
	<input name="txtAddress" type="text" class="txtinput" id="txtAddress" value="<tpl> $member_array.address </tpl>" /></td>
  </tr>

  <tr>
    <td height="30" width="150" align="left" valign="middle"></td>
    <td height="30" width="480" align="left" valign="middle"><span class="btn_left">
      <input  type="submit" class="btn_submit" name="Submit" value="<tpl> $langSysMemSubmit </tpl>" /></span>
      <span class="btn_left"> <input id="butt_list" class="btn_submit" type="button" value="<tpl> $langSysMemReturnList </tpl>" /> </span> </td>
  </tr>
</table>
</form>
<script type="text/javascript" language="javascript">
$(document).ready(function(){
	//日历
	$("#f_date").datepicker();
	//地区选择
	tonext('#c1');
	//返回列表
	$("#butt_list").click(function(){
		ShowDiv = "result_content";
		getPageContent("member.manage.php?action=ajax_list&state=<tpl> $condition.state </tpl>&txtloginname=<tpl> $condition.txtloginname </tpl>&start_date=<tpl> $condition.start_date </tpl>&end_date=<tpl> $condition.end_date </tpl>&txtemail=<tpl> $condition.txtemail </tpl>&curpage=<tpl> $curpage </tpl>");
	});

	var options_modi = {
		beforeSubmit:  function(){showLoading(showText);},
		success:       function(msg){
						hideLoading();
						showMessage(msg.message,msg.type);
						if(msg.type == '1'){
							ShowDiv = "result_content";
							getPageContent("member.manage.php?action=ajax_list&state=<tpl> $condition.state </tpl>&txtloginname=<tpl> $condition.txtloginname </tpl>&start_date=<tpl> $condition.start_date </tpl>&end_date=<tpl> $condition.end_date </tpl>&txtemail=<tpl> $condition.txtemail </tpl>&curpage=<tpl> $curpage </tpl>");
						}
					},
		type:      'post',
		dataType:  'json'
	};
	$("#form_modi").validate({
		errorClass: "wrong",
		rules: {
			txtemail: {required:true,email:true},
			txtPassword: {minlength:6,maxlength:16}
		},
		messages: {
			txtemail: {required:"<tpl> $langSysMemberMailNotNull </tpl>",email:"<tpl> $langSysMemberMailFormatErr </tpl>"},
			txtPassword: {minlength:"<tpl> $alertSysMEnterPassword </tpl>",maxlength:"<tpl> $alertSysMEnterPassword </tpl>"}
		},
		submitHandler: function() {
			$('#form_modi').ajaxSubmit(options_modi);
		}
	});
});
function tonext(whos) {
	$(whos).change(
		function(){
			var valarray=$(this).val().split('||');	
			$('#area_id').val(valarray[0]);
			if (valarray[1]=='1') {
				$(this).next().attr('disabled','true').html('<option value="" selected="selected"><tpl> $langCDataToLoading </tpl></option>');
				$.get(
					'../home/tohtml.php',
					{action:'get_area',id:valarray[0],random_number:Math.random()},
					function(data){
						DataArray = data.split("|||");
						var a='';
						for (var i = 0; i<DataArray.length-1; i++) {
							att=DataArray[i].split("||");
							id=att[0];
							cla=att[2];
							a+='<option value="'+id+'||'+cla+'">'+att[1]+((cla=='1')?' ->':'')+'</option>';
						}
						
					$(whos).next().removeAttr('disabled').html('<option value="" selected="selected"></option>'+a).nextAll().html('');
					tonext($(whos).next());
					}
				)
			} else {
				$(whos).nextAll().html('').attr('disabled','true');
			};
		}
	)
};
</script>